<template>
	<view>
		<view class="pore" style="z-index: 999;">
			<u-navbar :title="name || '趣玩黄石'" bgColor="transparent" autoBack :fixed="false">
			</u-navbar>
		</view>
		<view class="ml30 mr30">
			<view v-if="listData.length > 0">
				<waterfall-flow :dataArray="listData"></waterfall-flow>
			</view>
		</view>
	</view>
</template>

<script>
	import waterfallFlow from '@/components/waterfall-flow/index.vue'
	import {
		getWanlist
	} from '@/common/api_wan.js'
	export default {
		components: {
			waterfallFlow
		},
		name: '',
		data() {
			return {
				name:'',
				id:'',
				listData: []
			}
		},
		onLoad(option) {
			this.id = option.id
			this.name = option.name
			this.getWanlist()
		},
		methods: {
			async getWanlist() {
				uni.showLoading({
					mask: true
				})
				const res = await getWanlist({
					id:this.id
				})
				if (res.code == 200) {
					this.listData = res.data
				}
				uni.hideLoading()
			},
			async receiveCoupon(item) {
				uni.showLoading({
					mask: true
				})
				const res = await receiveCoupon({
					id: item.id
				})
				if (res.code == 200) {
					this.show_yhq_success = true
					setTimeout(() => {
						this.show_yhq_success = false
					}, 1000)
				}
				uni.hideLoading()
			}
		}
	}
</script>

<style lang="scss">
	page {
		background-color: #F1FFED;
	}
	
</style>